//
//  NSObject+NSLog.m
//  ReviewDemo
//
//  Created by 龙 on 2018/3/17.
//  Copyright © 2018年 long. All rights reserved.
//

#import "NSObject+NSLog.h"
#import <objc/runtime.h>


@implementation NSObject (NSLog)

//重写 输出方法
//- (NSString *)description
//{
//    return [NSString stringWithFormat:@"%@", [self dictionaryRepresentation]];
//}

//- (NSDictionary *)dictionaryRepresentation {
//
//    NSMutableDictionary *mutableDict = [NSMutableDictionary dictionary];
//    unsigned int count = 0;
//    Ivar *iavrList = class_copyIvarList(self.class, &count);
//    for (int i = 0; i < count; i ++)
//    {
//        Ivar ivar = iavrList[i];
//        NSString *key = [NSString stringWithUTF8String:ivar_getName(ivar)];
//        NSLog(@"key ----- %@",key);
//
//        if ([self respondsToSelector:@selector(valueForKey:)])
//        {
//            if ([self valueForKey:key])
//            {
//                [mutableDict setValue:[self valueForKey:key] forKey:key];
//            }
//        }
//    }
//    free(iavrList);
//    return [NSDictionary dictionaryWithDictionary:mutableDict];
//}



@end
